Skip to content

feat(memory): inherit unset memory.extended.llm fields from main LLM - #101

Merged
jkyberneees merged 1 commit into
mainfrom
feat/memory-llm-partial-override
Jul 25, 2026
Merged

feat(memory): inherit unset memory.extended.llm fields from main LLM#101
jkyberneees merged 1 commit into
mainfrom
feat/memory-llm-partial-override

Conversation

@jkyberneees

Copy link
Copy Markdown
Contributor

Problem

memory.extended.llm was all-or-nothing: without both base_url and model, ResolveLLM fell back to the main client entirely. Operators could not override a single knob — e.g. disabling thinking for memory calls — without duplicating the parent's base_url/api_key/model.

Change

ResolveLLM now inherits empty fields (base_url, api_key, model, thinking, max_tokens, temperature) from the main *llm.Client before building the dedicated client. Partial overrides now work:

"llm": { "thinking": "disabled" }   // same model/endpoint, no reasoning for memory calls
"llm": { "model": "qwen2.5:7b" }    // cheaper model on the same backend

Fallback semantics are preserved: if base_url/model are still empty after inheritance (e.g. the main client is not an *llm.Client), it warns and reuses the main client as before. timeout_seconds is not inherited (the main client's timeout is unexported) and still defaults to 30s.

Docker setup

Both docker configs (config.godmode.json, config.restricted.json) now set memory.extended.llm.thinking: "disabled" via the new partial override, so memory extraction/rerank/predictor calls skip reasoning tokens while reusing the parent backend.

Testing

  • TestResolveLLMInheritsMainSettings — thinking-only override inherits base_url/api_key/model/max_tokens/temperature
  • TestResolveLLMPartialOverrideKeepsInheritedRest — model-only override keeps the parent backend
  • Existing fallback tests unchanged and passing; full internal/memory/... suite green with -race

Docs updated: docs/CONFIG.md (memory.extended.llm row) and docs/EXTENDED_MEMORY.md (Dedicated Memory LLM section).

memory.extended.llm was all-or-nothing: without base_url AND model it
fell back to the main client entirely, so operators could not override a
single knob (e.g. thinking) without duplicating the parent connection
settings.

ResolveLLM now inherits empty fields (base_url, api_key, model,
thinking, max_tokens, temperature) from the main *llm.Client before
building the dedicated client, enabling partial overrides such as:

  "llm": {"thinking": "disabled"}   // same model, no reasoning for memory
  "llm": {"model": "qwen2.5:7b"}    // cheaper model, same backend

Fallback semantics are preserved: if base_url/model are still empty
after inheritance, it warns and reuses the main client as before.

Also patch the docker configs (godmode + restricted) to disable thinking
for extended memory calls via the new partial override, and document the
inheritance behavior in CONFIG.md and EXTENDED_MEMORY.md.
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
odek 7b77c99 Commit Preview URL

Branch Preview URL
Jul 25 2026, 02:40 PM

@jkyberneees
jkyberneees merged commit c2d6f99 into main Jul 25, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant